package com.hyk.spring;

import com.hyk.pojo.MyUser;
import com.hyk.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StartIoc {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                "applicationContext.xml");
        UserService userService = (UserService) applicationContext.getBean("userService");
        MyUser userById = userService.findUserById(1);
        System.out.println("userById = " + userById);
    }

}
